export function inFun(a, b){
    let boolean = a in b;
    if(!b[a]){
        boolean = false
    }
    return boolean
}

export function getElements(){
    let animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')),[].slice.call(document.getElementsByClassName('bodymovie')));
    return animElements
}

export function getBody(){
    let body = document.getElementsByTagName('body')[0];
    return body
}

export function requestAnimationFrame(resume){
    window.requestAnimationFrame(resume);
}

export function appendChildFun(parentNode){
    document.appendChild(parentNode);
}

export function documentBody(def){
    let str = (document.body && def) ? 'svg' : 'canvas';
    return str
}

export function ifDocumentBody(){
    if(!document.body){// 待改
        this.isLoaded = true;
        fontData.list.forEach((data)=> {
            data.helper = createHelper(data);
            data.cache = {};
        });
        this.fonts = fontData.list;
        return;
    }
}

export function loadedSelectorFun(fontArr){
    let obj = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
    return obj
}

export function loadedSelectorQSA(){
    let obj = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
    return obj
}

export function documentAppendChild(l){
    document.body.appendChild(l);
}

export function loadedSelectorQSA2(){
    let obj = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
    return obj
}